<!DOCTYPE html>
<html lang="zh-CN">
  <head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width,initial-scale=1">
    <title>Feature -- 特色; 特征; 特点; | Ted Yuen的技术博客</title>
    <meta name="description" content="BrE /&#39;fiːtʃə/ ; AmE /&#39;fitʃɚ/

n. 容貌；特色，特征；特写或专题节目
vi. 起重要作用
vt. 以…为特色；由…主演；特写

时 态: featured, featuring, features

栗子

1. Feature Branching (新建)特性分支

[GitLab](https://docs.g ...">
    <meta name="generator" content="VuePress 1.4.0">
    
    
    <link rel="preload" href="/assets/css/0.styles.b6e5dee4.css" as="style"><link rel="preload" href="/assets/js/app.a5c0d474.js" as="script"><link rel="preload" href="/assets/js/15.57df9f8e.js" as="script"><link rel="preload" href="/assets/js/22.4f410a60.js" as="script"><link rel="prefetch" href="/assets/js/10.262e0963.js"><link rel="prefetch" href="/assets/js/11.03a057c9.js"><link rel="prefetch" href="/assets/js/12.63659604.js"><link rel="prefetch" href="/assets/js/13.0549c43a.js"><link rel="prefetch" href="/assets/js/14.e794c180.js"><link rel="prefetch" href="/assets/js/16.a0d9468b.js"><link rel="prefetch" href="/assets/js/17.06d3e00b.js"><link rel="prefetch" href="/assets/js/18.0d80b21a.js"><link rel="prefetch" href="/assets/js/19.1e9da99b.js"><link rel="prefetch" href="/assets/js/20.08d3d7c6.js"><link rel="prefetch" href="/assets/js/21.b1aee962.js"><link rel="prefetch" href="/assets/js/23.6d06a125.js"><link rel="prefetch" href="/assets/js/24.f7a70963.js"><link rel="prefetch" href="/assets/js/25.5ee1e916.js"><link rel="prefetch" href="/assets/js/26.7bdc3bcf.js"><link rel="prefetch" href="/assets/js/27.15c6e05a.js"><link rel="prefetch" href="/assets/js/28.ae822034.js"><link rel="prefetch" href="/assets/js/29.170e7a57.js"><link rel="prefetch" href="/assets/js/3.d6f86d84.js"><link rel="prefetch" href="/assets/js/30.191f3008.js"><link rel="prefetch" href="/assets/js/31.5175acc4.js"><link rel="prefetch" href="/assets/js/32.73255ebc.js"><link rel="prefetch" href="/assets/js/33.203b8fc2.js"><link rel="prefetch" href="/assets/js/4.a2169bd0.js"><link rel="prefetch" href="/assets/js/5.894072dc.js"><link rel="prefetch" href="/assets/js/6.f66a1900.js"><link rel="prefetch" href="/assets/js/7.cbb4d687.js"><link rel="prefetch" href="/assets/js/8.d2217048.js"><link rel="prefetch" href="/assets/js/9.0d6d3c54.js"><link rel="prefetch" href="/assets/js/vuejs-paginate.643397bf.js">
    <link rel="stylesheet" href="/assets/css/0.styles.b6e5dee4.css">
  </head>
  <body>
    <div id="app" data-server-rendered="true"><div class="theme-container no-sidebar" data-v-c305a0ca><header class="navbar" data-v-c305a0ca><div class="sidebar-button"><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" role="img" viewBox="0 0 448 512" class="icon"><path fill="currentColor" d="M436 124H12c-6.627 0-12-5.373-12-12V80c0-6.627 5.373-12 12-12h424c6.627 0 12 5.373 12 12v32c0 6.627-5.373 12-12 12zm0 160H12c-6.627 0-12-5.373-12-12v-32c0-6.627 5.373-12 12-12h424c6.627 0 12 5.373 12 12v32c0 6.627-5.373 12-12 12zm0 160H12c-6.627 0-12-5.373-12-12v-32c0-6.627 5.373-12 12-12h424c6.627 0 12 5.373 12 12v32c0 6.627-5.373 12-12 12z"></path></svg></div> <a href="/" class="home-link router-link-active"><!----> <span class="site-name">Ted Yuen的技术博客</span></a> <div class="links"><div class="search-box"><input aria-label="Search" autocomplete="off" spellcheck="false" value=""> <!----></div> <nav class="nav-links can-hide"><div class="nav-item"><a href="/" class="nav-link">
  博文
</a></div><div class="nav-item"><a href="/tag/" class="nav-link">
  标签云
</a></div><div class="nav-item"><div class="dropdown-wrapper"><button type="button" aria-label="专栏" class="dropdown-title"><span class="title">专栏</span> <span class="arrow right"></span></button> <ul class="nav-dropdown" style="display:none;"><li class="dropdown-item"><!----> <a href="/tag/Vocabulary/" class="nav-link">
  程序员英语词汇
</a></li></ul></div></div><div class="nav-item"><a href="https://github.com/tedyuen" target="_blank" rel="noopener noreferrer" class="nav-link external">
  GitHub
  <svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg></a></div> <!----></nav></div></header> <div class="sidebar-mask" data-v-c305a0ca></div> <aside class="sidebar" data-v-c305a0ca><nav class="nav-links"><div class="nav-item"><a href="/" class="nav-link">
  博文
</a></div><div class="nav-item"><a href="/tag/" class="nav-link">
  标签云
</a></div><div class="nav-item"><div class="dropdown-wrapper"><button type="button" aria-label="专栏" class="dropdown-title"><span class="title">专栏</span> <span class="arrow right"></span></button> <ul class="nav-dropdown" style="display:none;"><li class="dropdown-item"><!----> <a href="/tag/Vocabulary/" class="nav-link">
  程序员英语词汇
</a></li></ul></div></div><div class="nav-item"><a href="https://github.com/tedyuen" target="_blank" rel="noopener noreferrer" class="nav-link external">
  GitHub
  <svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg></a></div> <!----></nav>  <!----> </aside> <div data-v-c305a0ca><main class="page"> <article class="theme-default-content"><header><h1 itemprop="name headline" class="post-title">
        Feature -- 特色; 特征; 特点;
      </h1> <div class="post-meta"><div itemprop="publisher author" itemtype="http://schema.org/Person" itemscope="itemscope" class="post-meta-author"><svg xmlns="http://www.w3.org/2000/svg" width="24px" height="24px" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-navigation"><polygon points="3 11 22 2 13 21 11 13 3 11"></polygon></svg> <span itemprop="name">Ted Yuen</span> <span itemprop="address">   in Shanghai</span></div> <div class="post-meta-date"><svg xmlns="http://www.w3.org/2000/svg" width="24px" height="24px" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-clock"><circle cx="12" cy="12" r="10"></circle><polyline points="12 6 12 12 16 14"></polyline></svg> <time pubdate itemprop="datePublished" datetime="2020-04-23T00:00:00.000Z">
      Thu Apr 23 2020
    </time></div> <ul itemprop="keywords" class="post-meta-tags"><li class="post-tag" data-v-6958873e><a href="/tag/Vocabulary" data-v-6958873e> Vocabulary </a></li></ul></div></header> <div class="content__default"><p><strong>BrE</strong> /'fiːtʃə/ ; <strong>AmE</strong> /'fitʃɚ/</p> <ol><li>n. 容貌；特色，特征；特写或专题节目</li> <li>vi. 起重要作用</li> <li>vt. 以…为特色；由…主演；特写</li></ol> <p>时 态: featured, featuring, features</p> <h3 id="栗子"><a href="#栗子" class="header-anchor">#</a> 栗子</h3> <h4 id="_1-feature-branching-新建-特性分支"><a href="#_1-feature-branching-新建-特性分支" class="header-anchor">#</a> 1. Feature Branching (新建)特性分支</h4> <p><a href="https://docs.gitlab.com/ee/university/training/topics/feature_branching.html" target="_blank" rel="noopener noreferrer">GitLab<svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg></a>的在线文档中有关于 <code>Feature Branching</code> 的介绍，先让我们来围观一下。(git基础知识就不再赘述了)</p> <h5 id="feature-branching"><a href="#feature-branching" class="header-anchor">#</a> Feature branching</h5> <ul><li>Efficient parallel workflow for teams</li> <li>Develop each feature in a branch</li> <li>Keeps changes isolated</li> <li>Consider a 1-to-1 link to issues</li> <li>Push branches to the server frequently
<ul><li>Hint: This is a cheap backup for your work-in-progress code</li></ul></li></ul> <h5 id="feature-branching-sample-workflow"><a href="#feature-branching-sample-workflow" class="header-anchor">#</a> Feature branching sample workflow</h5> <ol><li>Create a new feature branch called ‘squash_some_bugs’</li> <li>Edit ‘bugs.rb’ and remove all the bugs.</li> <li>Commit</li> <li>Push</li></ol> <div class="language-bash line-numbers-mode"><pre class="language-bash"><code><span class="token function">git</span> checkout -b squash_some_bugs
<span class="token comment"># Edit `bugs.rb`</span>
<span class="token function">git</span> status
<span class="token function">git</span> <span class="token function">add</span> bugs.rb
<span class="token function">git</span> commit -m <span class="token string">'Fix some buggy code'</span>
<span class="token function">git</span> push origin squash_some_bugs
</code></pre> <div class="line-numbers-wrapper"><span class="line-number">1</span><br><span class="line-number">2</span><br><span class="line-number">3</span><br><span class="line-number">4</span><br><span class="line-number">5</span><br><span class="line-number">6</span><br></div></div><p>简单来说，当你希望添加一个新的功能或特性，但又不想影响主分支的开发，可以开一个feature分支，等测试流程结束并且通过业务审核再合并到主分支。大家刚接触git的时候，是否能见到很多被命名为xxx-featrue或者feature-xxx的分支呢？没错，这就是团队内的Feature branching。具体的细节可以参考这篇<a href="http://www.bubuko.com/infodetail-2913566.html" target="_blank" rel="noopener noreferrer">中文博文<svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg></a></p> <h4 id="_2-feature-flags-功能发布控制"><a href="#_2-feature-flags-功能发布控制" class="header-anchor">#</a> 2. Feature Flags 功能发布控制</h4> <p>和<code>Feature branching</code>一样，是一种持续集成的方案。他的主要手段是通过类似于配置文件来控制线上功能开启或者关闭。
他的存在是为了解决<code>Feature branching</code>这种分支开发周期很长，造成主分支已经有大量的变动，会给合并带来隐患。但是CI/CD并没有万能的方案，两种方式都有各自的优缺点，关于优缺点，这篇<a href="https://www.sohu.com/a/270420651_711529" target="_blank" rel="noopener noreferrer">博文<svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg></a>有详细的阐述。我就不复制了。</p> <p>让我们来看一下 <code>React</code> How to Contribute中的 <code>Feature Flags</code> 来体会一下吧:</p> <blockquote><p>Feature Flags</p></blockquote> <blockquote><p>To keep the master branch in a releasable state, breaking changes and experimental features must be gated behind a feature flag.</p></blockquote> <blockquote><p>Feature flags are defined in packages/shared/ReactFeatureFlags.js. Some builds of React may enable different sets of feature flags; for example, the React Native build may be configured differently than React DOM. These flags are found in packages/shared/forks. Feature flags are statically typed by Flow, so you can run yarn flow to confirm that you’ve updated all the necessary files.</p></blockquote> <blockquote><p>React’s build system will strip out disabled feature branches before publishing. A continuous integration job runs on every commit to check for changes in bundle size. You can use the change in size as a signal that a feature was gated correctly.</p></blockquote></div> <footer class="page-edit"><!----> <!----></footer> <!----> <div class="vocabulary"><div>关注公众号【程序员英语词汇】获取最新内容</div> <img src="/images/wechat.jpg" alt="程序员英语词汇"></div></article> </main></div> <footer data-v-c305a0ca>Copyright © 2020 Ted Yuen</footer></div><div class="global-ui"><!----></div></div>
    <script src="/assets/js/app.a5c0d474.js" defer></script><script src="/assets/js/15.57df9f8e.js" defer></script><script src="/assets/js/22.4f410a60.js" defer></script>
  </body>
</html>
